<div class="panel panel-default" ng-controller="BusShiftListCtrl">
	<div class="panel-heading">
		跨城巴士 / 发班计划
	</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.shiftNo" class="form-control" placeholder="班次号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.fromAddr" class="form-control" placeholder="始发站">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.toAddr" class="form-control" placeholder="终点站">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
							<ui-select-match placeholder="状态">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="status in statusList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" status.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="routeList.selected" theme="bootstrap">
							<ui-select-match placeholder="线路">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="route in routeList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" route.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="routeList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.startTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="开始时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.endTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="结束时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-1">
				<div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
			</div>
		</form>
	</div>
	<p class="m-l-xl">提示：红色字体标识出来的班次说明该班次已暂停，班次前有共享标记的说明该班次已共享汽车票班次。</p>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width:10px;"></th>
					<th style="width:180px;">班次号</th>
					<th style="width:100px;">状态</th>
					<th style="width:80px;">发班日期</th>
					<th style="width:80px;">发班时间</th>
					<th style="width:100px;">线路名</th>
					<th style="width:120px;">始发站</th>
					<th style="width:120px;">终点站</th>
					<th style="width:80px;">已售/总票</th>
					<th style="width:80px;">最低票价</th>
					<th style="width:80px;">最高票价</th>
					<th style="width:120px;">操作</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="shift in dataList" ng-style="shift.paused?{color: 'red'}:{color: '#58666e'}">
					<td></td>
					<td>
                        <span tooltip="已共享汽车票班次" ng-if="shift.shiftAttachedId > 0">
					        <i class="fa fa-share-alt"></i>
					    </span>   {{shift.shiftNo}}</td>
					<td>{{shift.status | busShiftFilter}}</td>
					<td>{{shift.departDate| date : 'yyyy-MM-dd'}}</td>
					<td>{{shift.departTime| date : 'HH:mm:ss'}}</td>
					<td>{{shift.routeName}}</td>
					<td>{{shift.fromAddr}}</td>
					<td>{{shift.toAddr}}</td>
					<td>{{shift.ticketSold}}/{{shift.tickets}}</td>
					<td>{{shift.priceMin | number:2}}</td>
					<td>{{shift.priceMax | number:2}}</td>
					<td>
						<div class="row list-icon">
					        <a href tooltip="站点屏蔽"  has-authority="BUS_SHIFT_BAN">
								<i class="fa fa-ban" ng-click="updateStation(shift)"></i>
							</a>
							<a href tooltip="详情" ui-sref="app.bus.shiftDetail({shiftId: shift.id})" target="_blank">
								<i class="icon-info"></i>
							</a>
							<a href tooltip="票价修改" has-authority="BUS_SHIFT_UPDATE">
								<i class="fa fa-money" ng-click="updatePrice(shift)"></i>
							</a>
							<a href tooltip="删除" has-authority="BUS_SHIFT_UPDATE" ng-show="shift.status<1">
								<i class="fa fa-times" ng-click="del('sm',shift ,'delete')"></i>
							</a>
							<a href tooltip="修改" has-authority="BUS_SHIFT_UPDATE"
							ng-if="shift.status!=4&&shift.status!=3">
								<i class="fa fa-pencil" ng-click="write('lg',shift,'update')"></i>
							</a>
							<a href ng-if="shift.status != 0 && shift.status != 7" tooltip="查看票池"
							ui-sref="app.bus.shiftTicket({shiftId: shift.id})" target="_blank">
								<i class="fa fa-tags"></i>
							</a>
							<a href tooltip="暂停班次" has-authority="BUS_SHIFT_UPDATE"
							ng-if="!shift.paused&&shift.status!=3&&shift.status!=4">
								<i class="fa fa-pause" ng-click="pause(shift)"></i>
							</a>
							<a href tooltip="延迟发班" has-authority="BUS_SHIFT_UPDATE"
							ng-if="!shift.paused&&shift.status!=3&&shift.status!=4">
								<i class="fa fa-bell" ng-click="delayed(shift)"></i>
							</a>
							<a href tooltip="复制班次" has-authority="BUS_SHIFT_UPDATE">
								<i class="fa fa-copy" ng-click="copy(shift)"></i>
							</a>
						</div>
					</td>
				</tr>
				<tr ng-show="dataList==''">
					<td colspan="13" style="text-align: center;">暂无班次信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer/>
</div>